//k1 edit 2021.12.09

if (!isServer) exitwith {};

private ["_center", "_staticWeaponClasses", "_parkedVehicleClasses"];
private ["_object", "_pos", "_marker", "_instanceNo", "_randomNo", "_gun", "_angle", "_car"];
_center = _this select 0;


_staticWeaponClasses = _this select 1;
_parkedVehicleClasses = _this select 2;
private _rotation = random 360;

[_center,25] call a3e_fnc_cleanupTerrain;

if (isNil "drn_BuildAmmoDepot_MarkerInstanceNo") then {
	drn_BuildAmmoDepot_MarkerInstanceNo = 0;
}
else {
	drn_BuildAmmoDepot_MarkerInstanceNo = drn_BuildAmmoDepot_MarkerInstanceNo + 1;
};
_instanceNo = drn_BuildAmmoDepot_MarkerInstanceNo;

_fnc_rotatePos = {
private ["_centerPos", "_pos", "_dir"];
private ["_px", "_py", "_mpx", "_mpy", "_ma", "_rpx", "_rpy"];
_centerPos = _this select 0;
_pos = _this select 1;
_dir = _this select 2;
    _px = _pos select 0;
    _py = _pos select 1;
    _mpx = _centerPos select 0;
    _mpy = _centerPos select 1;
    _ma = _dir;
    _rpx = ( (_px - _mpx) * cos(_ma) ) + ( (_py - _mpy) * sin(_ma) ) + _mpx;
    _rpy = (-(_px - _mpx) * sin(_ma) ) + ( (_py - _mpy) * cos(_ma) ) + _mpy;
[_rpx, _rpy, (_pos select 2)];
};

_pos = [_center,_center vectorAdd [-11.54,11.8442,-0.00143862],_rotation] call _fnc_rotatePos;
_obj = "Land_LampHalogen_F" createvehicle _pos;
_obj setdir (225 + _rotation);
_obj setPosATL _pos;

_pos = [_center,_center vectorAdd [-9.55957,-9.13525,4.25966],_rotation] call _fnc_rotatePos;
_obj = "Land_BagFence_Round_F" createvehicle _pos;
_obj setdir (90 + _rotation);
_obj setPosATL _pos;//

_pos = [_center,_center vectorAdd [-8.07471,-10.645,4.22763],_rotation] call _fnc_rotatePos;
_obj = "Land_BagFence_Round_F" createvehicle _pos;
_obj setdir (0 + _rotation);
_obj setPosATL _pos;//

_pos = [_center,_center vectorAdd [-6.53955,-9.302,4.22464],_rotation] call _fnc_rotatePos;
_obj = "Land_BagFence_Round_F" createvehicle _pos;
_obj setdir (270 + _rotation);
_obj setPosATL _pos;//

_pos = [_center,_center vectorAdd [-8,-7.73096,4.19741],_rotation] call _fnc_rotatePos;
_obj = "Land_BagFence_Round_F" createvehicle _pos;
_obj setdir (180 + _rotation);
_obj setPosATL _pos;//

_pos = [_center,_center vectorAdd [-9.09229,-1.79858,-0.00143909],_rotation] call _fnc_rotatePos;
_obj = "Land_HBarrierWall6_F" createvehicle _pos;
_obj setdir (270 + _rotation);
_obj setPosATL _pos;

_pos = [_center,_center vectorAdd [-9.46045,6.35278,-0.00143909],_rotation] call _fnc_rotatePos;
_obj = "Land_HBarrierWall6_F" createvehicle _pos;
_obj setdir (270 + _rotation);
_obj setPosATL _pos;

_pos = [_center,_center vectorAdd [-8.3291,-7.5293,2.02836],_rotation] call _fnc_rotatePos;
_obj = "Land_SandbagBarricade_01_half_F" createvehicle _pos;
_obj setdir (0 + _rotation);
_obj setPosATL _pos;

_pos = [_center,_center vectorAdd [10.5059,-13.0449,-0.00143909],_rotation] call _fnc_rotatePos;
_obj = "Land_SignM_WarningMilitaryArea_english_F" createvehicle _pos;
_obj setdir (0 + _rotation);
_obj setPosATL _pos;

_pos = [_center,_center vectorAdd [-0.430664,-10.1777,-0.00143909],_rotation] call _fnc_rotatePos;
_obj = "Land_HBarrierWall6_F" createvehicle _pos;
_obj setdir (180 + _rotation);
_obj setPosATL _pos;

_pos = [_center,_center vectorAdd [7.87109,6.7605,-0.00143909],_rotation] call _fnc_rotatePos;
_obj = "Land_HBarrierWall6_F" createvehicle _pos;
_obj setdir (90 + _rotation);
_obj setPosATL _pos;

_pos = [_center,_center vectorAdd [-7.79492,9.42065,-0.00143909],_rotation] call _fnc_rotatePos;
_obj = "Land_HBarrierWall6_F" createvehicle _pos;
_obj setdir (0 + _rotation);
_obj setPosATL _pos;

_pos = [_center,_center vectorAdd [5.86475,9.88843,-0.00143909],_rotation] call _fnc_rotatePos;
_obj = "Land_HBarrierWall6_F" createvehicle _pos;
_obj setdir (0 + _rotation);
_obj setPosATL _pos;

_pos = [_center,_center vectorAdd [11.104,-7.61475,-0.00143909],_rotation] call _fnc_rotatePos;
_obj = "Land_HBarrierWall6_F" createvehicle _pos;
_obj setdir (90 + _rotation);
_obj setPosATL _pos;

_pos = [_center,_center vectorAdd [9.45605,-0.633057,-0.00143909],_rotation] call _fnc_rotatePos;
_obj1 = "Land_HBarrierTower_F" createvehicle _pos;
_obj1 setdir (270 + _rotation);
_obj1 setPosATL _pos;

_pos = [_center,_center vectorAdd [-7.83789,-7.76514,-0.00143909],_rotation] call _fnc_rotatePos;
_obj2 = "Land_HBarrierTower_F" createvehicle _pos;
_obj2 setdir (0 + _rotation);
_obj2 setPosATL _pos;

_pos = [_center,_center vectorAdd [-1,10.95,-0.00143909],_rotation] call _fnc_rotatePos;
_obj3 = "Land_HBarrierTower_F" createvehicle _pos;
_obj3 setdir (180 + _rotation);
_obj3 setPosATL _pos;

_pos = [_center,_center vectorAdd [-0.508789,10.7144,2.02836],_rotation] call _fnc_rotatePos;
_obj = "Land_SandbagBarricade_01_half_F" createvehicle _pos;
_obj setdir (180 + _rotation);
_obj setPosATL _pos;

_pos = [_center,_center vectorAdd [9.2207,-1.12476,2.02836],_rotation] call _fnc_rotatePos;
_obj = "Land_SandbagBarricade_01_half_F" createvehicle _pos;
_obj setdir (270 + _rotation);
_obj setPosATL _pos;

_pos = [_center,_center vectorAdd [8.13428,-12.0725,-0.00143909],_rotation] call _fnc_rotatePos;
_obj = "Land_ConcreteWall_01_l_gate_F" createvehicle _pos;
_obj setdir (0 + _rotation);
_obj setPosATL _pos;
_obj allowDamage false;

_pos = [_center,_center vectorAdd [13.2056,-12.001,-0.00143909],_rotation] call _fnc_rotatePos;
_obj = createVehicle ["FlagPole_F", _pos, [], 0, "NONE"];
_obj setdir (0 + _rotation);
_obj setPosATL _pos;
_obj setflagtexture A3E_VAR_Flag_Opfor;


    // Cars
	_parkedVehicleClasses append ["C_Heli_Light_01_civil_F","B_Heli_Light_01_F","I_Heli_light_03_unarmed_F"];
    if (random 10 > 1) then {
        _car = selectRandom _parkedVehicleClasses;
    }else{
        _car = "";
    };
    
    if (_car != "") then {
		_pos = [_center,_center vectorAdd [3,0.948975,0],_rotation] call _fnc_rotatePos;
		_obj = createvehicle [_car, [0,0,999], [], 0, "NONE"];
		_obj setdir (180 + _rotation);
		_obj setPosATL _pos;

		if !(_obj isKindOf "air") then {[_obj,A3E_VAR_Side_Opfor] spawn A3E_fnc_AddStaticGunner};
		
		//_obj allowDamage false;
		Escape_all_assets pushback _obj;
		_obj setVariable ["Escape_assets_control", true, true];
    };

 // Statics
    
    if (count _staticWeaponClasses > 0) then {
        _gun = selectRandom _staticWeaponClasses;
		_static = createVehicle [_gun, [0,0,999], [], 0, "NONE"];
		_static attachTo [_obj2,[-.5,-1,3.7]];
		detach _static;
		_static setdir (getdir _obj2 -180);
		Escape_allStatics pushback _static;
		Escape_all_assets pushback _static;
		_static setVariable ["Escape_assets_control", true, true];
    }; ////
    //if (count a3e_arr_ComCenStaticWeapons > 0) then {
		_StaticWeapons = a3e_arr_Escape_SWC_MG_H + a3e_arr_Escape_SWC_GM_H;
        _gun = selectRandom _StaticWeapons;
		_static = createVehicle [_gun, [0,0,999], [], 0, "NONE"];
		_static attachTo [_obj1,[-.5,-2,1.7]];
		detach _static;
		Escape_allStatics pushback _static;
		Escape_all_assets pushback _static;
		_static setVariable ["Escape_assets_control", true, true];
		
        _gun = selectRandom _StaticWeapons;
		_static = createVehicle [_gun, [0,0,999], [], 0, "NONE"];
		_static attachTo [_obj3,[-.5,-2,1.7]];
		detach _static;
		Escape_allStatics pushback _static;
		Escape_all_assets pushback _static;
		_static setVariable ["Escape_assets_control", true, true];
    //};
	_StaticWeapons = a3e_arr_Escape_SWC_MG + a3e_arr_Escape_SWC_MG_H + a3e_arr_Escape_SWC_MG_A;
	if (random 10 > 1) then {
        _gun = selectRandom _StaticWeapons;
		_pos = [_center,_center vectorAdd [-7.60205,7.37891,0.0767112],_rotation] call _fnc_rotatePos;
		_static = createVehicle [_gun, [0,0,999], [], 0, "NONE"];
		_static setdir (144 + _rotation);
		_static setPosATL _pos;
		Escape_allStatics pushback _static;
		Escape_all_assets pushback _static;
		_static setVariable ["Escape_assets_control", true, true];
	};
	if (random 10 > 1) then {
        _gun = selectRandom _StaticWeapons;
		_pos = [_center,_center vectorAdd [-3.07227,-8.70557,0.077374],_rotation] call _fnc_rotatePos;
		_static = createVehicle [_gun, [0,0,999], [], 0, "NONE"];
		_static setdir (87.58 + _rotation);
		_static setPosATL _pos;
		Escape_allStatics pushback _static;
		Escape_all_assets pushback _static;
		_static setVariable ["Escape_assets_control", true, true];
	};
	if (random 10 > 1) then {
        _gun = selectRandom _StaticWeapons;
		_pos = [_center,_center vectorAdd [5.91797,7.82813,0.0767102],_rotation] call _fnc_rotatePos;
		_static = createVehicle [_gun, [0,0,999], [], 0, "NONE"];
		_static setdir (180.7 + _rotation);
		_static setPosATL _pos;
		Escape_allStatics pushback _static;
		Escape_all_assets pushback _static;
		_static setVariable ["Escape_assets_control", true, true];
	};



// Weapons
//_pos = [_center,_center vectorAdd [-0.278687,-7.39478,0],_rotation] call _fnc_rotatePos;
//_obj = "Box_Ammo_F" createvehicle _pos;
//_obj setVectorDirAndUp [[-0.999874,-0.0158694,0],[-0,0,1]];

    private ["_weapons", "_weaponMagazines", "_box", "_weaponCount"];

    // Basic Weapon Box
    
    _weapons = [];
    _weaponMagazines = [];
    
    for "_i" from 0 to (count a3e_arr_AmmoDepotBasicWeapons - 1) do {
        private ["_handGunItem", "_weaponClassName", "_probabilityOfPrecence", "_minCount", "_maxCount", "_magazines", "_magazinesPerWeapon"];
        
        _handGunItem = a3e_arr_AmmoDepotBasicWeapons select _i;
        
        _weaponClassName = _handGunItem select 0;
        _probabilityOfPrecence = _handGunItem select 1;
        _minCount = _handGunItem select 2;
        _maxCount = _handGunItem select 3;
        _magazines = _handGunItem select 4;
        _magazinesPerWeapon = _handGunItem select 5;
        
        if (random 100 <= _probabilityOfPrecence) then {
            _weaponCount = floor (_minCount + random (_maxCount - _minCount));
            _weapons pushBack [_weaponClassName, _weaponCount];
            
            for "_j" from 0 to (count _magazines) - 1 do {
                _weaponMagazines pushBack [_magazines select _j, _weaponCount * _magazinesPerWeapon];
            };
        };
    };
    
    if (count _weapons > 0 || {count _weaponMagazines > 0}) then {
        //_box = "Box_East_Wps_F" createVehicle [(_middlePos select 0) - 3, (_middlePos select 1) + 0, 0];
        //_box = createVehicle ["Box_East_Wps_F", [(_middlePos select 0) - 3, (_middlePos select 1) + 0, 0], [], 0, "CAN_COLLIDE"];
		
		_pos = [_center,_center vectorAdd [-3,2.94995,-0.00144005],_rotation] call _fnc_rotatePos;
		_box = "Box_East_Wps_F" createvehicle _pos;
		_box setdir (360 + _rotation);
		_box setPosATL _pos;
		_box allowDamage false; //
		
        clearWeaponCargoGlobal _box;
        clearMagazineCargoGlobal _box;
        clearItemCargoGlobal _box;
		clearBackpackCargoGlobal _box;

        
        {
            _box addWeaponCargoGlobal _x;
        } foreach _weapons;
        
        {
            _box addMagazineCargoGlobal _x;
        } foreach _weaponMagazines;
    };

    // Special Weapon Box
    
    _weapons = [];
    _weaponMagazines = [];
    
    for "_i" from 0 to (count a3e_arr_AmmoDepotSpecialWeapons - 1) do {
        private ["_handGunItem", "_weaponClassName", "_probabilityOfPrecence", "_minCount", "_maxCount", "_magazines", "_magazinesPerWeapon"];
        
        _handGunItem = a3e_arr_AmmoDepotSpecialWeapons select _i;
        
        _weaponClassName = _handGunItem select 0;
        _probabilityOfPrecence = _handGunItem select 1;
        _minCount = _handGunItem select 2;
        _maxCount = _handGunItem select 3;
        _magazines = _handGunItem select 4;
        _magazinesPerWeapon = _handGunItem select 5;
        
        if (random 100 <= _probabilityOfPrecence) then {
            _weaponCount = floor (_minCount + random (_maxCount - _minCount));
            _weapons pushBack [_weaponClassName, _weaponCount];
            
            for "_j" from 0 to (count _magazines) - 1 do {
                _weaponMagazines pushBack [_magazines select _j, _weaponCount * _magazinesPerWeapon];
            };
        };
    };
    
    if (count _weapons > 0 || {count _weaponMagazines > 0}) then {
        //_box = "Box_East_WpsLaunch_F" createVehicle [(_middlePos select 0) + 3, (_middlePos select 1) + 0, 0];
		_pos = [_center,_center vectorAdd [-6,0.949951,-0.00144005],_rotation] call _fnc_rotatePos;
		_box = "Box_East_WpsLaunch_F" createvehicle _pos;
		_box setdir (360 + _rotation);
		_box setPosATL _pos;
		_box allowDamage false; //
		
        clearWeaponCargoGlobal _box;
        clearMagazineCargoGlobal _box;
        clearItemCargoGlobal _box;
		clearBackpackCargoGlobal _box;
        
        {
            _box addWeaponCargoGlobal _x;
        } foreach _weapons;
        
        {
            _box addMagazineCargoGlobal _x;
        } foreach _weaponMagazines;
    };

	/*if((Param_Waffelbox)==1) then {
		_box = createVehicle [a3e_additional_weapon_box_1, [(_middlePos select 0) + 0, (_middlePos select 1) + 3, 0], [], 0, "CAN_COLLIDE"];
		_box = createVehicle [a3e_additional_weapon_box_2, [(_middlePos select 0) + 3, (_middlePos select 1) + 3, 0], [], 0, "CAN_COLLIDE"];
	 };*/
    // Ordnance
    
    _weapons = [];
    _weaponMagazines = [];
    
    for "_i" from 0 to (count a3e_arr_AmmoDepotOrdnance - 1) do {
        private ["_handGunItem", "_weaponClassName", "_probabilityOfPrecence", "_minCount", "_maxCount", "_magazines", "_magazinesPerWeapon"];
        
        _handGunItem = a3e_arr_AmmoDepotOrdnance select _i;
        
        _weaponClassName = _handGunItem select 0;
        _probabilityOfPrecence = _handGunItem select 1;
        _minCount = _handGunItem select 2;
        _maxCount = _handGunItem select 3;
        _magazines = _handGunItem select 4;
        _magazinesPerWeapon = _handGunItem select 5;
        
        if (random 100 <= _probabilityOfPrecence) then {
            _weaponCount = floor (_minCount + random (_maxCount - _minCount));
            _weapons pushBack [_weaponClassName, _weaponCount];
            
            for "_j" from 0 to (count _magazines) - 1 do {
                _weaponMagazines pushBack [_magazines select _j, _weaponCount * _magazinesPerWeapon];
            };
        };
    };
    
    if (count _weapons > 0 || {count _weaponMagazines > 0}) then {
        //_box = "Box_East_WpsSpecial_F" createVehicle [(_middlePos select 0) + 0, (_middlePos select 1) - 3, 0];
        //_box = createVehicle ["Box_East_WpsSpecial_F", [(_middlePos select 0) + 0, (_middlePos select 1) - 3, 0], [], 0, "CAN_COLLIDE"];
		
		_pos = [_center,_center vectorAdd [-6,2.94995,-0.00144053],_rotation] call _fnc_rotatePos;
		_box = "Box_East_WpsSpecial_F" createvehicle _pos;
		_box setdir (2 + _rotation);
		_box setPosATL _pos;
		_box allowDamage false; //
		
        clearWeaponCargoGlobal _box;
        clearMagazineCargoGlobal _box;
        clearItemCargoGlobal _box;
		clearBackpackCargoGlobal _box;
        
        {
            _box addWeaponCargoGlobal _x;
        } foreach _weapons;
        
        {
            _box addMagazineCargoGlobal _x;
        } foreach _weaponMagazines;
    };
    
    // Vehicle
    
    _weapons = [];
    _weaponMagazines = [];
    
    for "_i" from 0 to (count a3e_arr_AmmoDepotVehicle - 1) do {
        private ["_handGunItem", "_weaponClassName", "_probabilityOfPrecence", "_minCount", "_maxCount", "_magazines", "_magazinesPerWeapon"];
        
        _handGunItem = a3e_arr_AmmoDepotVehicle select _i;
        
        _weaponClassName = _handGunItem select 0;
        _probabilityOfPrecence = _handGunItem select 1;
        _minCount = _handGunItem select 2;
        _maxCount = _handGunItem select 3;
        _magazines = _handGunItem select 4;
        _magazinesPerWeapon = _handGunItem select 5;
        
        if (random 100 <= _probabilityOfPrecence) then {
            _weaponCount = floor (_minCount + random (_maxCount - _minCount));
            _weapons pushBack [_weaponClassName, _weaponCount];
            
            for "_j" from 0 to (count _magazines) - 1 do {
                _weaponMagazines pushBack [_magazines select _j, _weaponCount * _magazinesPerWeapon];
            };
        };
    };
	
	 _items = [];
	 for "_i" from 0 to (count a3e_arr_AmmoDepotVehicleItems - 1) do {
        private ["_item", "_itemClassName", "_probabilityOfPrecence", "_minCount", "_maxCount"];
        
        _item = a3e_arr_AmmoDepotVehicleItems select _i;
        
        _itemClassName = _item select 0;
        _probabilityOfPrecence = _item select 1;
        _minCount = _item select 2;
        _maxCount = _item select 3;
        
        if (random 100 <= _probabilityOfPrecence) then {
            _itemCount = floor (_minCount + random (_maxCount - _minCount));
            _items pushback [_itemClassName, _itemCount];
        };
    };
	
	
    if (count _weapons > 0 || {count _weaponMagazines > 0} || {count _items > 0}) then {
        //_box = "Box_NATO_AmmoVeh_F" createVehicle [(_middlePos select 0) + 0, (_middlePos select 1) + 0, 0];
        //_box = createVehicle ["Box_NATO_AmmoVeh_F", [(_middlePos select 0) + 0, (_middlePos select 1) + 0, 0], [], 0, "CAN_COLLIDE"];
		
		_pos = [_center,_center vectorAdd [-3,0.949951,0.0291023],_rotation] call _fnc_rotatePos;
		_box = "Box_NATO_AmmoVeh_F" createvehicle _pos;
		_box setdir (360 + _rotation);
		_box setPosATL _pos;
		_box allowDamage false; //

        clearWeaponCargoGlobal _box;
        clearMagazineCargoGlobal _box;
        clearItemCargoGlobal _box;
		clearBackpackCargoGlobal _box;
        
        {
            _box addWeaponCargoGlobal _x;
        } foreach _weapons;
        
        {
            _box addMagazineCargoGlobal _x;
        } foreach _weaponMagazines;
		{
            _box addBackpackCargoGlobal [_x,4];
        } foreach a3e_arr_AmmoDepotVehicleBackpacks;
		{
            _box addItemCargoGlobal _x;
        } foreach _items;
    };
    
    // Items

    _weapons = [];
    
    for "_i" from 0 to (count a3e_arr_AmmoDepotItems - 1) do {
        private ["_item", "_itemClassName", "_probabilityOfPrecence", "_minCount", "_maxCount"];
        
        _item = a3e_arr_AmmoDepotItems select _i;
        
        _itemClassName = _item select 0;
        _probabilityOfPrecence = _item select 1;
        _minCount = _item select 2;
        _maxCount = _item select 3;
        
        if (random 100 <= _probabilityOfPrecence) then {
            _itemCount = floor (_minCount + random (_maxCount - _minCount));
            _weapons pushBack [_itemClassName, _itemCount];
        };
    };
    
    if (count _weapons > 0) then {
        //_box = "Box_East_Wps_F" createVehicle [(_middlePos select 0) + 0, (_middlePos select 1) + 3, 0];
        //_box = createVehicle ["Box_East_Wps_F", [(_middlePos select 0) + 3, (_middlePos select 1) - 3, 0], [], 0, "CAN_COLLIDE"];

		_pos = [_center,_center vectorAdd [-3,4.94995,-0.00144005],_rotation] call _fnc_rotatePos;
		_box = "Box_East_Wps_F" createvehicle _pos;
		_box setdir (0 + _rotation);
		_box setPosATL _pos;
		_box allowDamage false; //

        clearWeaponCargoGlobal _box;
        clearMagazineCargoGlobal _box;
        clearItemCargoGlobal _box;
		clearBackpackCargoGlobal _box;
        
        {_box addItemCargoGlobal _x} foreach _weapons;
    };

    // Launchers
    
    _weapons = [];
    _weaponMagazines = [];
    
    for "_i" from 0 to (count a3e_arr_AmmoDepotLaunchers - 1) do {
        private ["_handGunItem", "_weaponClassName", "_probabilityOfPrecence", "_minCount", "_maxCount", "_magazines", "_magazinesPerWeapon"];
        
        _handGunItem = a3e_arr_AmmoDepotLaunchers select _i;
        
        _weaponClassName = _handGunItem select 0;
        _probabilityOfPrecence = _handGunItem select 1;
        _minCount = _handGunItem select 2;
        _maxCount = _handGunItem select 3;
        _magazines = _handGunItem select 4;
        _magazinesPerWeapon = _handGunItem select 5;
        
        if (random 100 <= _probabilityOfPrecence) then {
            _weaponCount = floor (_minCount + random (_maxCount - _minCount));
            _weapons set [count _weapons, [_weaponClassName, _weaponCount]];
            
            for "_j" from 0 to (count _magazines) - 1 do {
                _weaponMagazines set [count _weaponMagazines, [_magazines select _j, _weaponCount * _magazinesPerWeapon]];
            };
        };
    };
    
    if (count _weapons > 0 || {count _weaponMagazines > 0}) then {
        //_box = "Box_East_WpsLaunch_F" createVehicle [(_middlePos select 0) - 3, (_middlePos select 1) - 3, 0];
        //_box = createVehicle ["Box_East_WpsLaunch_F", [(_middlePos select 0) - 3, (_middlePos select 1) - 3, 0], [], 0, "CAN_COLLIDE"];
		
		_pos = [_center,_center vectorAdd [-6,4.94995,0],_rotation] call _fnc_rotatePos;
		_box = "Box_East_WpsLaunch_F" createvehicle _pos;
		_box setdir (0 + _rotation);
		_box setPosATL _pos;
		_box allowDamage false; //

        clearWeaponCargoGlobal _box;
        clearMagazineCargoGlobal _box;
        clearItemCargoGlobal _box;
		clearBackpackCargoGlobal _box;
        
        {_box addWeaponCargoGlobal _x} foreach _weapons;
        { _box addMagazineCargoGlobal _x} foreach _weaponMagazines;
    };
	
	Escape_campType_arr pushback [_center,"补给点","k1"];
	publicVariable "Escape_campType_arr";

    // Set markers
    
    //_marker = createMarker ["drn_AmmoDepotMapMarker" + str _instanceNo, _middlePos];
    //_marker setMarkerType "o_installation";
      //_marker setMarkerType "o_installation";
	  
    ["drn_AmmoDepotMapMarker" + str _instanceNo,_center,"o_installation"] call A3E_fnc_createLocationMarker;

    _marker = createMarkerLocal ["drn_AmmoDepotPatrolMarker" + str _instanceNo, _center];
    _marker setMarkerShapeLocal "ELLIPSE";
    _marker setMarkerAlphaLocal 0;
    _marker setMarkerSizeLocal [50, 50];